<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/public/default.xhtml">
   
   	<f:metadata>
   			<f:viewParam name="seqNo" value="#{serviceSupplierController.seqNo}"></f:viewParam>   	
   			<f:event listener="#{serviceSupplierController.init()}" type="preRenderView"></f:event>
	   		<f:event listener="#{serviceSupplierHome.setInstance(serviceSupplierController.serviceSupplier)}" type="preRenderView"></f:event>	
   	</f:metadata>
   
	<ui:define name="content">
		<h:form id="queryForm">
			<p:panel id="panel" header="审核进度查询" style="margin-bottom:10px;">
		       <p:messages id="messages" closable="true" autoUpdate="true"></p:messages>
		        
		        <h:panelGrid columns="2" cellpadding="5">
		        	<p:outputLabel for="seqNo" value="申请流水号"></p:outputLabel>
					<p:inputText
						id="seqNo"
						value="#{serviceSupplierController.seqNo}"
						required="true"
					></p:inputText>
				</h:panelGrid>
		    	    	
		    	<p:commandButton action="#{serviceSupplierController.init()}" ajax="false" value="查询">		    		
		    	</p:commandButton>
		    </p:panel>
		    
		     <c:set var="_supplier" value="#{serviceSupplierController.serviceSupplier}"/>
		    <p:tabView rendered="#{not empty serviceSupplierController.serviceSupplier}">
		        <p:tab title="基本信息">
		        	
		        	<p:panelGrid columns="2" cellpadding="5" style="width: 100%" columnClasses="label">
						<p:outputLabel value="公司名称" />		
						<h:outputText value="#{serviceSupplierHome.instance.cnname}" />		
												   
						<p:outputLabel value="单位性质或组织形式" />				
						<h:outputText id="companyType" 
									  value="#{serviceSupplierHome.instance.companyType}"/>
						
						<p:outputLabel value="统一社会信用代码" />
						<h:outputText id="creditCode" 
								   value="#{serviceSupplierHome.instance.creditCode}" />
						
						<p:outputLabel value="注册资金(万元)" />				
						<h:outputText id="registeredFund" 
								  value="#{serviceSupplierHome.instance.registeredFund}" />
						
						<p:outputLabel value="注册登记机关" />				
						<h:outputText id="registrationAuthority" 
								  value="#{serviceSupplierHome.instance.registrationAuthority}" />
						
						<p:outputLabel value="注册登记号" />				
						<h:outputText id="registrationNo" 
								  value="#{serviceSupplierHome.instance.registrationNo}" />
						
						<p:outputLabel value="成立时间" />		
						<h:outputText  id="regtime" 
									value="#{serviceSupplierHome.instance.regtime}">
							<f:convertDateTime pattern="yyyy-MM-dd"/>
						</h:outputText>
						
						<p:outputPanel>
							<p:outputLabel value="营业执照" /><br/>
							（扫描图片上传）
						</p:outputPanel>	
						<div id="imgsPreview" >
							<img  data-original="#{attachmentUtils.getFullPath(serviceSupplierHome.instance.businessLicenseImages[0])}" src="#{attachmentUtils.getFullPath(serviceSupplierHome.instance.businessLicenseImages[0])}"  width="240"/>
						</div>				
						
						<p:outputLabel value="办公地址" />				
						<h:outputText id="address" 
								  value="#{serviceSupplierHome.instance.address}" />
						
						<p:outputLabel value="法定代表人" />				
						<h:outputText id="legalPerson" 
								  value="#{serviceSupplierHome.instance.legalPerson}" />
						
						<p:outputLabel value="法定代表人联系电话" />				
						<h:outputText id="legalPersonPhoneNumber" 
								  value="#{serviceSupplierHome.instance.legalPersonPhoneNumber}" />
						
						<p:outputLabel value="第一联系人" />				
						<h:outputText id="firstContactor" 
								  value="#{serviceSupplierHome.instance.firstContactor}" />
						
						<p:outputLabel value="第一联系人电话" />				
						<h:outputText id="firstContactorPhoneNumber" 
								  value="#{serviceSupplierHome.instance.firstContactorPhoneNumber}" />
						
						<p:outputLabel value="第二联系人" />				
						<h:outputText id="secondContactor" 
								  value="#{serviceSupplierHome.instance.secondContactor}" />
						
						<p:outputLabel value="第二联系人电话" />				
						<h:outputText id="secondContactorPhoneNumber" 
								  value="#{serviceSupplierHome.instance.secondContactorPhoneNumber}" />
						
						<p:outputLabel value="员工数" />				
						<h:outputText id="employeeCount" 
								  value="#{serviceSupplierHome.instance.employeeCount}" />
						
						<p:outputLabel value="高级职称人数" />				
						<h:outputText id="highTitleEmployeeCount" 
								  value="#{serviceSupplierHome.instance.highTitleEmployeeCount}" />
						
						<p:outputLabel value="中级职称人数" />				
						<h:outputText id="mediumTitleEmployeeCount" 
								  value="#{serviceSupplierHome.instance.mediumTitleEmployeeCount}" />
						
						<p:outputLabel value="初级职称人数" />				
						<h:outputText id="beginnerTitleEmployeeCount" 
								  value="#{serviceSupplierHome.instance.beginnerTitleEmployeeCount}" />
							   
						<p:outputLabel value="是否政府服务供应商" />				
						<h:outputText id="govServiceSupplier" 
								   value="#{certHome.instance.serviceSupplier.govServiceSupplier ? '是' : '否'}" />
											   
						<p:outputLabel value="中介机构所在地区" />		
						<h:outputText id="region"
								   value="#{serviceSupplierHome.instance.region}" />
						
						<p:outputLabel value="营业期限" />					
						<h:outputText id="businessAllotedTime"
								   value="#{serviceSupplierHome.instance.busnissAllotedTime}" 
								rendered="#{not serviceSupplierHome.instance.alwaysValid}">
							<f:convertDateTime pattern="yyyy-MM-dd"/>
						</h:outputText>
						<h:outputText value="长期有效"
								   rendered="#{serviceSupplierHome.instance.alwaysValid}" />
						
						<p:outputLabel for="intro" value="机构简介" />	
						<h:outputText id="intro"
								   value="#{serviceSupplierHome.instance.intro}" />
						
					</p:panelGrid>
		        	
		        </p:tab>
		        
		        <p:tab title="主营业务">
		        	<p:repeat var="_business" value="#{serviceSupplierHome.instance.mainBusinesses}" varStatus="_status">
		        		<p:panel header="主营业务#{_status.index + 1}">
		        			<p:panelGrid columns="2" columnClasses="label, value" style="width: 100%">
		        				<p:outputLabel value="服务事项" />	
								<h:outputText 
										   value="#{_business.agentService.name}" />
										   
								<p:outputLabel value="服务时限承诺" />	
								<h:outputText 
										   value="#{_business.commitOfTime}" />
										   
								<p:outputLabel value="服务收费承诺" />	
								<h:outputText 
										   value="#{_business.commitOfPrice}" />
										   
								<p:outputLabel value="服务质量承诺" />	
								<h:outputText 
										   value="#{_business.commitOfQuality}" />
		        			</p:panelGrid>
		        		</p:panel>
		        	</p:repeat>
		        </p:tab>
		        
		        <p:tab title="资质信息">
		        <p:repeat var="_cert" value="#{serviceSupplierHome.instance.certs}" varStatus="_status">
		        	<p:panel header="资质证书#{_status.index+1}">
	            			<p:dataTable  value="#{_cert.qualificationTemplates}" var="_template" >
	            				<p:column headerText="资质分类">
								<h:outputText value="#{_template.qualificationClass.name}" />
		            			</p:column>
		            			
		            			<p:column headerText="所属行业" colspan="3">
									<h:outputText value="#{_template.getSectorNames()}" />
		            			</p:column>
		            			
		            			<p:column headerText="证书等级">
									<h:outputText value="#{_template.qualificationLevel.name}" />
		            			</p:column>
		            			
		            			<p:column headerText="#{_template.qualificationClass.auditDepartment.cnname}审核结果">
									<h:outputText value="未审核" rendered="#{empty _cert.auditResult}" />
									<h:outputText value="通过" rendered="#{_cert.auditResult}" />
									<h:outputText value="驳回" rendered="#{not empty _cert.auditResult and not _cert.auditResult}" />
		            			</p:column>
	            			</p:dataTable>
	            			
	            			<p:panel header="驳回信息"  rendered="#{not empty _cert.auditResult and not _cert.auditResult}">
	            				<h:panelGrid columns="2" cellpadding="5">
	            					<p:outputLabel  value="驳回时间" />				
									<h:outputText value="#{_cert.auditTime}" rendered="#{not empty _cert.auditResult and not _cert.auditResult}">
										<f:convertDateTime pattern="yyyy-MM-dd"/>
									</h:outputText>
									<p:outputLabel  value="驳回原因" />				
									<h:outputText value="#{_cert.currRejectRecord.reason}" rendered="#{not empty _cert.auditResult and not _cert.auditResult}" />            					
		            			</h:panelGrid>	
	            			</p:panel>
						</p:panel>		
		        
		        </p:repeat>
		            
		        </p:tab>
		    </p:tabView>
					
		</h:form>
		
	</ui:define>
   
</ui:composition>